{template header}
<script src="{SITE_URL}public/js/jeditable/jeditable.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(function() {

$(".editable_textarea").editable("{SITE_URL}index.php?app=group&ac=do&ts=edit_type", { 
  indicator : '<img src="'+siteUrl+'public/js/loading.gif">',
  type   : 'textarea',
  submitdata: { _method: "put"},
  select : true,
  submit : '确定',
  cancel : '取消',
  cssclass : "editable",
  tooltip   : '点击进行编辑......'
});

});

//删除帖子类型
function deltopictype(typeid){
	if(confirm("确定删除吗？")){
		$.ajax({
			type: "POST",
			url: siteUrl+'index.php?app=group&ac=do&ts=del_type',
			data: "&typeid=" + typeid,
			beforeSend: function(){},
			success: function(result){
				if(result == '0'){
					window.location.reload(); 	
				}
			}
		});
	}
}

</script>

<div class="container">


<div class="bbox">
<div class="bc">
{template edit_xbar}


<div class="row">
<div class="col-md-8">



<form class="form-inline" method="POST" action="{SITE_URL}index.php?app=group&ac=do&ts=topic_type">
  <div class="form-group">
    <label class="sr-only">添加帖子分类：</label>
    <input name="typename" class="form-control" placeholder="添加帖子分类">
  </div>

<input type="hidden" name="groupid" value="{$strGroup[groupid]}" />
  <button type="submit" class="btn btn-default">添加帖子分类</button>
</form>



<table class="table">
<thead>
<tr>
<th>类型</th><th>操作</th>
</tr>
</thead>

<tbody>
{loop $arrGroupType $key $item}
<tr>
<td class="editable_textarea" id="{$item[typeid]}">{$item[typename]}</td><td><a href="javascript:void('0');" onclick="deltopictype('{$item[typeid]}')">删除</a></td>
</tr>
{/loop}
</tbody>
</table>


</div>
<div class="col-md-4"></div>
</div>



</div>
</div>

</div>
{template footer}